<extend name="Index/index"/>
<block name='right'>
<div class="rightBody">
	<span class='title'>编辑分类</span>
	<div id="content">
		<form  class='registerform' action="<{:U('Goods/edit_handle')}>" method="post" enctype="multipart/form-data">
			<table class='table table-striped table-bordered'>
				<thead>
					<tr>
						<th >名称</th>
						<th >值</th>
					</tr>
				</thead>
				<tbody>
						<tr>
							<td>商铺名称</td>
							<td>

									<select name="shopid" id="">
									<option value="0">请选择商铺</option>
									<volist name='shoprows' id='shoprow'>
										<if condition="$row['shopid'] eq $shoprow['shopid']">
											<option value="<{$shoprow['shopid']}>" selected><{$shoprow['shopname']}></option>
										<else/>
											<option value="<{$shoprow['shopid']}>"><{$shoprow['shopname']}></option>
										</if>
									</volist>
									</select>
								
							</td>
						</tr>
					
						<tr>
							<td>分类名称</td>
							<td>
								<select name="cid" id="">
										<option value="0">请选择分类</option>
										<volist name='caterows' id='caterow'>
											<if condition="$row['cid'] eq $caterow['cid']">
												<option value="<{$caterow['cid']}>" selected>|<{$caterow['html']}><{$caterow['cname']}></option>
											<else/>
												<option value="<{$caterow['cid']}>">|<{$caterow['html']}><{$caterow['cname']}></option>
											</if>
										</volist>
								</select>
							</td>
						</tr>
						<tr>
							<td>所在地区</td>
							<td>
								<select name="lid" id="">
										<option value="0">请选择地区</option>
										<volist name='localrows' id='localrow'>
											<if condition="$row['lid'] eq $localrow['lid']">
												<option value="<{$localrow['lid']}>" selected>|<{$localrow['html']}><{$localrow['lname']}></option>
											<else/>
												<option value="<{$localrow['lid']}>">|<{$localrow['html']}><{$localrow['lname']}></option>
											</if>
										</volist>
								</select>
							</td>
						</tr>
					<tr>
						<td>商品主标题</td>
						<td>
							<input type="text" name="main_title" value="<{$row['main_title']}>" datatype="*1-35" errormsg="长度1-35位任意字符"  nullmsg="商品主标题不能为空" sucmsg="填写正确" />
							<span class="Validform_checktip" >不能超过35个字</span>
						</td>
					</tr>
					<tr>
						<td>商品副标题</td>
						<td>
							<input type="text" name="sub_title" value="<{$row['sub_title']}>" datatype="*1-100" errormsg="长度1-100位任意字符"  nullmsg="商品副标题不能为空" sucmsg="填写正确"/>
							<span class="Validform_checktip" >不能超过100个字</span>
						</td>
					</tr>
					<tr>
						<td>商品现价</td>
						<td>
							<input type="text" name="price" value="<{$row['price']}>" datatype="n" errormsg="必须为数字"  nullmsg="价格不能为空" sucmsg="填写正确"/>
						</td>
					</tr>
					<tr>
						<td>商品原价</td>
						<td>
							<input type="text" name="old_price" value="<{$row['old_price']}>" datatype="n" errormsg="必须为数字" nullmsg="价格不能为空" sucmsg="填写正确"/>
						</td>
					</tr>

					<tr>
						<td>商品图片展示</td>
						<td>
							<input type="file" name="goods_img">
						</td>
					</tr>
					<tr>
						<input type="hidden" name="old_img" value="<{$row['goods_img']}>">
						<td>原图</td>
						<td><img src="__PUBLIC__/Uploads/200x100_<{$row['goods_img']}>" alt=""></td>
					</tr>
					<tr>
						<td>商品服务</td>
						<td>
							<volist name='serverrows' id='serverrow'>
							<if condition="in_array($i,$goods_server)">
								<input type="checkbox" name="goods_server[]" value="<{$i}>" checked><{$serverrow}><br/>
							<else/>
								<input type="checkbox" name="goods_server[]" value="<{$i}>"><{$serverrow}><br/>
							</if>
							</volist>
							
						</td>
					</tr>
					<tr>
						<td>商品细节展示</td>
						<td>
							<!-- 加载编辑器的容器  -->
							<textarea style="width:520px;" name="detail" id="ueditor" >
								<{$row['detail']}>
							</textarea>
							
						</td>
					</tr>
					<input type="hidden" name="gid" value="<{$row['gid']}>">
					<tr>
						<td></td>
						<td><input type="submit" class='btn btn-primary' /></td>
					</tr>

				</tbody>
			</table>
		</form>
	</div>
</div>
<!-- Ueditor配置 开始-->
<!-- 配置文件 -->
<script type="text/javascript" src="__ROOT__/Public/Ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__ROOT__/Public/Ueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
      window.UEDITOR_HOME_URL ="__ROOT__/Public/Ueditor/";//指出ueditor的存放路径
      window.onload=function(){
          UE.getEditor('ueditor');//要传入一个ID才能显示编辑器，即textarea中的id
      }
</script>
<!-- Ueditor配置 结束-->
</block>
